//
//  TrackingSlideViewController.m
//  myDemo2
//
//  Created by wuxueying on 14-4-17.
//
//

#import "TrackingSlideViewController.h"
#import "ASValueTrackingslider.h"

@interface TrackingSlideViewController ()
@property (weak, nonatomic) IBOutlet ASValueTrackingSlider *slide1;
@property (weak, nonatomic) IBOutlet ASValueTrackingSlider *slide2;
@property (weak, nonatomic) IBOutlet ASValueTrackingSlider *slide3;
@property (weak, nonatomic) IBOutlet ASValueTrackingSlider *slide4;
@end
@implementation TrackingSlideViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.slide1.maximumValue = 2.0;
    self.slide2.maximumValue = 255.0;
    [self.slide2 setMaxFractionDigitsDisplayed:0];
    self.slide2.popUpViewColor = [UIColor colorWithHue:0.55 saturation:0.8 brightness:0.9 alpha:0.7];
    self.slide2.font = [UIFont fontWithName:@"Menlo-Bold" size:22];
    self.slide2.textColor = [UIColor colorWithHue:0.55 saturation:1.0 brightness:0.5 alpha:1];
    NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
    [formatter setNumberStyle:NSNumberFormatterPercentStyle];
    [self.slide3 setNumberFormatter:formatter];
    self.slide3.font = [UIFont fontWithName:@"Futura-CondensedExtraBold" size:26];
    self.slide3.popUpViewAnimatedColors = @[[UIColor purpleColor], [UIColor redColor], [UIColor orangeColor]];
    NSNumberFormatter *tempFormatter = [[NSNumberFormatter alloc] init];
    [tempFormatter setPositiveSuffix:@"°C"];
    [tempFormatter setNegativeSuffix:@"°C"];
    [self.slide4 setNumberFormatter:tempFormatter];
    self.slide4.minimumValue = -20.0;
    self.slide4.maximumValue = 60.0;
    UIColor *darkBlue = [UIColor colorWithHue:0.6 saturation:1.0 brightness:0.6 alpha:1.0];
    UIColor *blue = [UIColor colorWithHue:0.6 saturation:0.8 brightness:0.9 alpha:1.0];
    UIColor *green = [UIColor colorWithHue:0.3 saturation:0.8 brightness:0.8 alpha:1.0];
    UIColor *yellow = [UIColor colorWithHue:0.15 saturation:1.0 brightness:0.9 alpha:1.0];
    UIColor *red = [UIColor colorWithHue:0.0 saturation:1.0 brightness:1.0 alpha:1.0];
    [self.slide4 setPopUpViewAnimatedColors:@[darkBlue, blue, green, yellow, red]
                               withPositions:@[@-20, @0, @5, @25, @60]];
}

@end
